class IT:
    def __init__(self):
        self.count = -1

    def __iter__(self):
        return self

    def __next__(self):
        self.count += 1
        if self.count == 3:
            raise StopIteration
        return self.count


if __name__ == "__main__":
    it = IT()
    it1 = it.__next__()
    print(it1)
    it2 = next(it)
    print(it2)
    it3 = it.__next__()
    print(it3)
    obj2 = IT()
    for i in obj2:
        print("-------0i", i)
